package org.gd.hellojaxb.privat24.other;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "news")
public class NewsErrorWrapper {

    private Throwable e;
    private String clazz;
    private String message;

    public NewsErrorWrapper() {
    }

    public NewsErrorWrapper(Throwable e) {
        this.e = e;
        this.clazz = e.getClass().getSimpleName();
        this.message = e.getMessage();
    }

    public NewsErrorWrapper(String clazz, String message) {
        this.clazz = clazz;
        this.message = message;
    }

    @XmlElement(name = "err")
    public String getClazz() {
        return clazz;
    }

    @XmlElement(name = "mes")
    public String getMessage() {
        return message;
    }

    public Throwable getException() {
        return e;
    }
}
